package ro.ase.catalog.security.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import ro.ase.catalog.beans.*;
import ro.ase.catalog.security.dao.ITeacherDisciplineClassDAO;
import ro.ase.catalog.security.service.ITeacherDisciplineClassService;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Ioana
 * Date: 5/14/14
 * Time: 12:08 AM
 * To change this template use File | Settings | File Templates.
 */
public class TeacherDisciplineClassServiceImpl implements ITeacherDisciplineClassService {
    @Autowired
    private ITeacherDisciplineClassDAO teacherDisciplineClassDAO;
    public Teacher checkAssociation(String discipline, String cls) {
        return teacherDisciplineClassDAO.checkAssociation(discipline, cls);
    }

    public void saveTeacherDisciplineClass(TeacherDisciplineClass teacherDisciplineClass) {
           teacherDisciplineClassDAO.save(teacherDisciplineClass);
     }

    public Discipline findDisciplineByName(String discipline) {
        return teacherDisciplineClassDAO.findDisciplineByName(discipline);
    }

    public List<Discipline> getAllDisciplines() {
        return teacherDisciplineClassDAO.getAllDisciplines();
    }

    public List<TeacherDisciplineClass> getAllClassByTeacher(Teacher teacher) {
        return teacherDisciplineClassDAO.getAllClassByTeacher(teacher);
    }

    public TeacherDisciplineClass getByClassAndTeacher(Teacher teacher, SchoolClass schoolClass) {
        return teacherDisciplineClassDAO.getByClassAndTeacher(teacher,schoolClass);  //To change body of implemented methods use File | Settings | File Templates.
    }

    public List<TeacherDisciplineClass> getAllDisciplinesByStudent(Student student) {
        return teacherDisciplineClassDAO.getAllDisciplinesByStudent(student);
    }

    public ITeacherDisciplineClassDAO getTeacherDisciplineClassDAO() {
        return teacherDisciplineClassDAO;
    }

    public void setTeacherDisciplineClassDAO(ITeacherDisciplineClassDAO teacherDisciplineClassDAO) {
        this.teacherDisciplineClassDAO = teacherDisciplineClassDAO;
    }
}
